package intf

import (
	C "gitee.com/ljfirst/algo-go-sdk/common/constant"
	"gitee.com/ljfirst/algo-go-sdk/src/data_structure/list"
)

/**
 * @author ljfirst
 * @version V1.0
 * @date 2023/6/28 16:56
 * @author-Email ljfirst@mail.ustc.edu.cn
 * @blogURL https://blog.csdn.net/ljfirst
 * @description 链表
 * */
type ListINTF interface {
	Insert(...*list.Node)           // 默认插在最后面
	InsertIndex(int, ...*list.Node) // 当index=0的时候，默认插在最前面

	Delete(*list.Node)
	DeleteIndex(int)

	ValueSet() []interface{}
	Equals(*list.Node)
	Size() int
	Clear()
	GetAttribute() *C.Attribute
}

type LastKINTF interface {
	FindMethod(*list.Node, int) *list.Node
	Delete(*list.Node, int) *list.Node
	GetAttribute() *C.Attribute
}

var ListAssemble = map[string][]interface{}{
	"List": {
		&list.SkipList{},
		&list.SimplexList{},
		&list.DuplexList{},
	},
	"LastK": {
		&list.LastKRecursion{},
		&list.LastKTwoPoint{},
	},
}
